package com.example.server;

import com.example.silvercare.R;
import com.example.silvercare.UserInputCheck;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.Editable;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

public class GetAllFriendsLocationSetting extends Activity {

	EditText proximityText;
	int proximity;
	Button runButton;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.getallfriendslocationsetting);
		proximityText = (EditText)findViewById(R.id.proximityText);
		runButton = (Button) findViewById(R.id.getallfriendslocationButton);
		
		runButton.setOnClickListener(new OnClickListener(){

			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				String p = proximityText.getText().toString();
				p = UserInputCheck.removeBlankSpace(p);
				if(p==null || p=="")
					proximity = -1;
				else
					proximity = Integer.parseInt(p);
				Intent i = new Intent("com.example.server.GetAllFriendsLocation");
				i.putExtra("PROXIMITY", proximity);
				startActivity(i);
			}
			
		});
		
	}

}
